function d_wcp_min_index = overhead_singularity_detect(qs, DH_para)
Alpha = DH_para.Alpha;
A = DH_para.A;
D = DH_para.D;
Theta = DH_para.Theta;
Sigma = DH_para.Sigma;
a2 = A(2); a3 = A(3); a4 = A(4);
d1 = D(1); d3 = D(3); d4 = D(4); d6 = D(6);

[n, m] = size(qs);

for i = 1:n
    T01 = transformation_mdh(Alpha(1), A(1), D(1), Theta(1), Sigma(1), qs(i, 1));
    T12 = transformation_mdh(Alpha(2), A(2), D(2), Theta(2), Sigma(2), qs(i, 2));
    T23 = transformation_mdh(Alpha(3), A(3), D(3), Theta(3), Sigma(3), qs(i, 3));
    T34 = transformation_mdh(Alpha(4), A(4), D(4), Theta(4), Sigma(4), qs(i, 4));
    
    T_wcp = T01 * T12 * T23 * T34;
    d_wcp(i) = sqrt(T_wcp(1, 4)^2 + T_wcp(1, 4)^2);
end

[d_wcp_min, d_wcp_min_index] = min(d_wcp);